<?php

namespace App\Http\Controllers;

use App\Logic\MiGuLogic;
use Illuminate\Support\Facades\DB;

class RefreshMoney extends Base
{

    public function logic()
    {
        $object = DB::table('t_player_info')->where('id',$this->uid)->where('status',1)->first([
            'gold','diamonds','room_ticket','migu_id'
        ]);
        $migu_info = MiGuLogic::instance()->get_migu_user_info((int)$object->migu_id);
        $arr["uid"]      = $this->uid;
        $arr["gold"]     = $object->gold ?? 0;
        $arr["diamonds"] = $migu_info['diamond'];
        $arr["room_ticket"] = $migu_info['roomcard'];
        return $this->returnData($arr);
    }

}